import "./assets/main.css";
import { createApp } from "vue";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
// 引入进度条
import "./nprogress";
const app = createApp(App);
// 注册所有图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
// 创建 Pinia 实例
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
// 使用 pinia-plugin-persist 插件
app.use(pinia);
app.use(router);
app.use(ElementPlus);

// 注册语言
import { i18n } from "@/lang/index";
app.use(i18n);
app.mount("#app");
// 注册组件
// 表单
import form from "@/components/form.vue";
app.component("sx-form", form);
// 表格
import table from "@/components/table.vue";
app.component("sx-table", table);
// 分页
import pagination from "@/components/pagination.vue";
app.component("sx-pagination", pagination);
